import 'package:flutter/material.dart';

class AboutPage extends StatelessWidget {
  static const String routeName = "about";

  AboutPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    int counter = ModalRoute.of(context)?.settings.arguments as int;
    return Scaffold(
      appBar: AppBar(
        title: Text("关于页面"),
      ),
      body: Center(
        child: TextButton(
            onPressed: () => back(context, counter),
            child: Text(
              "点击返回  当前计数：$counter",
              style: TextStyle(fontSize: 20, color: Colors.black),
            )),
      ),
    );
  }

  void back(BuildContext context, int counter) {
    Navigator.of(context).pop(counter + 1);
  }
}
